package com.gtxc.kotlinmvvm.ui.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;


import com.aleyn.mvvm.base.BaseActivity;
import com.drake.statusbar.StatusBarKt;
import com.gtxc.kotlinmvvm.BR;
import com.gtxc.kotlinmvvm.R;
import com.gtxc.kotlinmvvm.adapater.MyFenSiAdapater;
import com.gtxc.kotlinmvvm.bean.ViewItemBean;
import com.gtxc.kotlinmvvm.databinding.ActivityIncomedetailsBinding;
import com.gtxc.kotlinmvvm.view.MaterialSpinner;
import com.gtxc.kotlinmvvm.viewmodle.IncomeDetailsViewModle;

import java.util.ArrayList;
import java.util.List;


//收益团队
public class IncomeDetailsActivity extends BaseActivity<IncomeDetailsViewModle, ActivityIncomedetailsBinding> {
    private List<ViewItemBean> lists =new ArrayList<>();
    private MyFenSiAdapater adapter;

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {

    }

    @Override
    public int layoutId() {
        return R.layout.activity_incomedetails;
    }

    @Override
    public void initData() {

        getMBinding().toolbar.setTitleBackgroundColor(Color.WHITE);
        getMBinding().toolbar.setLeftBackgroundColor(R.mipmap.left_back);
        getMBinding().toolbar.setOnLeftClickListener(v -> finish());
        MaterialSpinner spinner = (MaterialSpinner) findViewById(R.id.spinner);
        spinner.setItems("显示所有人","在线","离线");
        spinner.setSelectedIndex(0);
        spinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {
            @Override
            public void onItemSelected(MaterialSpinner view, int position, long id, String item) {

            }
        });
        ViewItemBean viewItemBean1=new ViewItemBean("@Codeyyao","Mining-邀请您");
        ViewItemBean viewItemBean2=new ViewItemBean("@Codeyyao","Mining-邀请您");
        ViewItemBean viewItemBean3=new ViewItemBean("@Codeyyao","Mining-邀请您");
        ViewItemBean viewItemBean4=new ViewItemBean("@Codeyyao","Mining-邀请您");
        lists.add(viewItemBean1);
        lists.add(viewItemBean2);
        lists.add(viewItemBean3);
        lists.add(viewItemBean4);
        LinearLayoutManager manager =new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);

        getMBinding().listRecyclerView.setLayoutManager(manager);
        adapter =new MyFenSiAdapater(R.layout.meyfensi);
        adapter.addData(lists);

        getMBinding().listRecyclerView.setAdapter(adapter);
    }

    @Override
    public void initCLick() {

    }

    @Override
    public int variableID() {
        return BR.Incomedetailsviewmodle;
    }

    @Override
    public void bindViewModel() {

    }
}
